package com.uniinnovate.lanjingling.pojo.vo;

import com.uniinnovate.lanjingling.entity.JobApplicationEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * @author hym
 * @description 申请视图对象类
 */
@Data
@Accessors(chain = true)
@ApiModel("职位申请视图对象")
public class JobApplicationVO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 申请id
     */
    @ApiModelProperty("申请id")
    private Long applicationId;
    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    private Long userId;
    /**
     * 职位id
     */
    @ApiModelProperty("职位id")
    private Long jobId;
    /**
     * 简历id
     */
    @ApiModelProperty("简历id")
    private Long resumeId;
    /**
     * 身份证号
     */
    @ApiModelProperty("身份证号")
    private String idNum;
    /**
     * 电话号
     */
    @ApiModelProperty("电话号")
    private String phone;
    /**
     * 邮箱
     */
    @ApiModelProperty("邮箱")
    private String email;
    /**
     * 所在城市
     */
    @ApiModelProperty("所在城市")
    private String city;
    /**
     * 备用电话
     */
    @ApiModelProperty("备用电话")
    private String sparePhone;
    /**
     * 照片
     */
    @ApiModelProperty("照片")
    private String photo;

    public JobApplicationEntity toEntity() {
        JobApplicationEntity jobApplicationEntity = new JobApplicationEntity();
        BeanUtils.copyProperties(this, jobApplicationEntity);
        jobApplicationEntity.setIsWatch(0);
        return jobApplicationEntity;
    }
}
